﻿window.$jscript.fn.wangeditor = (function () {
    var __FN = function () {
        return new __FN.fn._init();
    };
    var hxt = window.$jscript.fn;
    __FN.fn = __FN.prototype = {
        _init: function () { return this; },
        param: { list: '', link: '' },
        ready: function (options) {
            var self = this;
            $.each(options, function (idx, item) {
                if (self.param.hasOwnProperty(idx)) {
                    self.param[idx] = item;
                }
            });
            hxt.config.link = self.param.link;
            self.initPage();
        },
        initPage: function () {
            var self = this;
            hxt.element.elVue = new Vue({
                data: function () {
                    var _this = this;
                    return {
                        list: JSON.parse(hxt.fromBase64(self.param.list)),
                    };
                },

                computed: {

                },
                mounted: function () {
                    var _this = this;
                },
                methods: {
                    playMedia: function (evt) {
                        var el = evt.currentTarget, videos = $('video');

                        $.each(videos, function (idx, item) {
                            if (item !== el) {
                                item.pause();
                            }
                        });
                    },
                },
                components: {
                }
            }).$mount('#app');
        }
    };
    __FN.fn._init.prototype = __FN.fn;
    return __FN.fn;
})();